package information;

/** 
 * Park class, with getters and setters, note that "directions" 
 * is called "location", because a street address is more useful 
 * in the age of mapquest. 
 * @author Barry Jones
 *
 */
public class Park {
		
	    /**
	     * the name of the park
	     */
	    private String myName;
	    
	    /**
	     * the region of the park
	     */
	    private String myRegion;
	    
	    /**
	     * the District of the park
	     */
	    private String myDistrict;
	    
	    /**
	     * the street address of the of the park 
	     */
	    private String myLocation;
	    
	    /**
	     * the bus route the park in on/ closest too the park
	     */
	    private String myBus;
	    
	    /**
		 * Creates a new Park. 
		 * 
		 * @param theName The park's name. 
		 * @param theRegion The region of the park
		 * @param theDistrict The district of the park
		 * @param theLocation The location of the park
		 * @param theBus The bus route of the park 
		 */
		public Park(final String theName, final String theRegion, final String theDistrict, final String theLocation, final String theBus) {
			myName = theName;
			myRegion = theRegion;
			myDistrict = theDistrict;
			myLocation = theLocation;
			myBus = theBus;

		}
	    /**
	     * returns the name of the park
	     * @return myName
	     */
		public String getMyName() {
			return myName;
		}
		/**
		 * changes the name of the park
		 * @param theName The park's new name. 
		 */
		public void setMyName(String myName) {
			this.myName = myName;
		}
		
		 /**
	     * returns the region of the park
	     * @return myRegion
	     */
		public String getMyRegion() {
			return myRegion;
		}
		
		/**
	     * changes the region of the park
	     * @param myRegion The park's new Region.
	     */
		public void setMyRegion(String myRegion) {
			this.myRegion = myRegion;
		}
		
		/**
	     * returns the District of the park
	     * @return myDistrict
	     */
		public String getMyDistrict() {
			return myDistrict;
		}
		/**
		 * changes the District of the park
		 * @param myDistrict The new district 
		 */
		public void setMyDistrict(String myDistrict) {
			this.myDistrict = myDistrict;
		}
		
		/**
	     * returns the Location of the park
	     * @return myLocation
	     */
		public String getMyLocation() {
			return myLocation;
		}
		/**
		 * changes the location of the park
		 * @param myLocation The new location
		 */
		public void setMyLocation(String myLocation) {
			this.myLocation = myLocation;
		}
		
		/**
	     * returns the bus route of the park
	     * @return myBus
	     */
		public String getMyBus() {
			return myBus;
		}
		/**
		 * changes the Bus route
		 * @param myBus The new bus route
		 */
		public void setMyBus(String myBus) {
			this.myBus = myBus;
		}
		
		/**
		   * Returns true if the two objects are equal. Returns false
		   * if the two objects are not equal. Two objects are equal if they have
		   * the same values in all of their fields. 
		   * 
		   * @param the_other An object to be compared. 
		   * @return True or False of whether the two objects are equal  
		   */
		public boolean equals(final Object theOther) {
			boolean isEqual = false;
			if (theOther == this ) isEqual = true;
			else if (theOther instanceof Park) {
				final Park theOtherCast = (Park) theOther;
				isEqual = myName.equals(theOtherCast.myName) && myRegion.equals(theOtherCast.myRegion) &&
						myDistrict.equals(theOtherCast.myDistrict) && myLocation.equals(theOtherCast.myLocation) &&
						myBus.equals(theOtherCast.myBus);
			}
			return isEqual;
		}
}
